import { defineStore } from 'pinia'
interface ICollectSource {
  id: undefined | string
  resource_type: undefined | number
  content_type: undefined | number
  status: undefined | number
  site_id: undefined | string
}
const useCollectManageStore = defineStore({
  id: 'collectManageStore',
  state: (): ICollectSource => ({
    id: undefined,
    resource_type: undefined,
    content_type: undefined,
    status: undefined,
    site_id: undefined
  }),
  getters: {},
  actions: {
    setCollect(status: number) {
      this.status = status
    }
  },
  persist: {
    enabled: true,
    strategies: [
      {
        key: 'collectManageStore', // 默认key是上面store的id，可自定义key
        storage: sessionStorage, // 默认是sessionStorage会话存储，可以设置为localStorage本地长存储
        paths: ['id', 'resource_type', 'content_type', 'status', 'site_id']
      }
    ]
  }
})
export default useCollectManageStore
